package std::collection;

import std::Object;

public class Stack : Collection
{
	m_vector->ArrayList;
	public Stack(){m_vector=new ArrayList();}
	public push(e->Object){m_vector.add(e);}
	public pop()->Object
	{
		if(m_vector.empty())return null;
		else{
			last->int=m_vector.size()-1;
			temp->Object=m_vector.get(last);
			m_vector.remove(last);
			return temp;
		}
	}
	public top()->Object
	{
		if(m_vector.empty())return null;
		else return m_vector.get(m_vector.size()-1);
	}
	public exist(e->Object)->boolean{return m_vector.exist(e);}
	public empty()->boolean{return m_vector.empty();}
	public clear(){m_vector.clear();}
	public size()->int{return m_vector.size();}
}